package org.wevil.util;

/**
 * 计时工具类
 * */
public class TimeUtil {

    private static Long start = 0L;
    private static Long now;

    /**
     * 重置开始时间
     * */
    public static void reset(){
        start = 0L;
    }

    /**
     * 计时
     * */
    public static long time(){
        if(start == 0L){
            start = System.currentTimeMillis();
            return 0;
        }else{
            now = System.currentTimeMillis();
            return (now - start) / 1000;
        }
    }
}
